package com.yunxi.controller.eai;

import com.yunxi.account.pojo.AccountCreditVO;
import com.yunxi.account.service.AccountCreditDubboService;
import com.yunxi.core.web.ApiResult;
import com.yunxi.core.web.CurrentUser;
import com.yunxi.core.web.LoginInfo;
import com.yunxi.core.web.ResponseUtil;
import com.yunxi.eai.pojo.esb.EaiManageLogVO;
import com.yunxi.eai.service.esb.ESBManageService;
import com.yunxi.eai.service.esb.ESBService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/admin/eai/manage")
@Api(tags = "eai:manage", description = "eai管理配置接口")
public class EaiManageController {
   private static final Logger logger = LoggerFactory.getLogger(EaiManageController.class);

   @Autowired
   private ESBManageService esbManageServiceImpl;

   @PostMapping("/page")
   @ApiOperation(value = "查询分页")
   public ApiResult page(@RequestBody EaiManageLogVO eaiManageLogVO) throws Exception {
      return ResponseUtil.ok(esbManageServiceImpl.findPageByVO(eaiManageLogVO));
   }

   @PostMapping("/list")
   @ApiOperation(value = "查询列表")
   public ApiResult list(@RequestBody EaiManageLogVO eaiManageLogVO) throws Exception {
      return ResponseUtil.ok(esbManageServiceImpl.listByVo(eaiManageLogVO));
   }

   @PostMapping("/load")
   @ApiOperation(value = "读取单个")
   public ApiResult load(@RequestBody EaiManageLogVO eaiManageLogVO) throws Exception {
      return ResponseUtil.ok(esbManageServiceImpl.getById(eaiManageLogVO.getLogId()));
   }


   @PostMapping("/resend")
   @ApiOperation(value = "重发")
   public ApiResult resend(@RequestBody EaiManageLogVO eaiManageLogVO) throws Exception {
      ApiResult apiResult=esbManageServiceImpl.resend(eaiManageLogVO);
      return apiResult;
   }

}
